<template>
	<view>
		<u-picker mode="time" v-model="show" :params="params" @confirm="confirm" @cancel="cancel"></u-picker>
	</view>
</template>

<script>
	export default {
		props: {
			// dateShow: {
			//       value: false,
			//       type: Boolean
			//     },
			index: {
				value: 0,
				type: Number
			}
		},
		data() {
			return {
				show: false,
				params: {
					year: true,
					month: true,
					day: true,
					hour: true,
					minute: true,
					second: false
				},
			}
		},
		methods: {
			open() {
				this.show = true;
			},
			confirm(e) {
				console.log(e,this.index, 'confirm')
				var obj = {
					time: e.year + '-' + e.month + '-' + e.day + ' ' + e.hour + ':' + e.minute,
					index: this.index
				} 
				this.$emit('confirm',obj)
			},
			cancel() {
				this.$emit('cancel')
				// this.show = false;
			},
		}
	}
</script>

<style>

</style>